import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getCategoryAPI } from "@/apis/layout";

export const useCategoryStore = defineStore('category', () => {
  // 分类的数据数组
  const categoryList = ref([]);
  // 获取分类数据
  const getCategoryList = async () => {
    const res = await getCategoryAPI();
    categoryList.value = res.result;
  };

  return {categoryList,  getCategoryList}
})